//
//  BaseViewController.m
//  LOLBox
//
//  Created by mac on 15-3-27.
//  Copyright (c) 2015年 Honey. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        // 全局设置状态栏白色
        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
        self.automaticallyAdjustsScrollViewInsets = NO;
        //self.view.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)initBgColor
{
    self.view.backgroundColor = [UIColor whiteColor];
}

//创建导航栏标题
- (void)createNavTitleView:(NSString *)str
{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 64)];
    label.text = str;
    label.font = [UIFont boldSystemFontOfSize:17];
    label.textColor = [UIColor whiteColor];
    label.textAlignment = NSTextAlignmentCenter;
    self.navigationItem.titleView = label;
}

//创建左侧返回按钮
- (void)createBackBarBtnWithTarget:(id)tar WithAction:(SEL)sel
{
    UIBarButtonItem *barbtn = [[UIBarButtons alloc] createBackBarButtonWithTarget:tar WithAction:sel];
    UIBarButtonItem *space = [[UIBarButtons alloc] createSpaceButtonWithWidth:-10];
    
    //左边按钮
    self.navigationItem.leftBarButtonItems = @[space,barbtn];
}

//搜索按钮
- (void)createSearchBarBtn
{
    UIBarButtonItem *barbtn = [[UIBarButtons alloc] createSearchBarButtonWithTarget:nil WithAction:nil];
    UIBarButtonItem *space = [[UIBarButtons alloc] createSpaceButtonWithWidth:-10];
    
    self.navigationItem.rightBarButtonItems = @[space,barbtn];

}

//进入下载
- (void)createDownloadBarBtnWithTarget:(id)tar WithAction:(SEL)sel
{
    UIBarButtonItem *barbtn = [[UIBarButtons alloc] createDownloadBarButtonWithTarget:tar WithAction:sel];
    UIBarButtonItem *space = [[UIBarButtons alloc] createSpaceButtonWithWidth:-10];
    
    //左边按钮
    self.navigationItem.leftBarButtonItems = @[space,barbtn];
}

//刷新
- (void)createRefreshBarBtn
{
    UIBarButtonItem *barbtn = [[UIBarButtons alloc] createRefreshBarButtonWithTarget:self WithAction:nil];
    UIBarButtonItem *space = [[UIBarButtons alloc] createSpaceButtonWithWidth:-10];

    self.navigationItem.rightBarButtonItems = @[space,barbtn];
}

//收藏
//- (void)createFavBarBtn
//{
//    self.navigationItem.rightBarButtonItem = [[UIBarButtons alloc] createFavBarButtonWithTarget:self WithAction:nil];
//}




- (void)pushDownloadView
{
    NSLog(@"进去下载界面");
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
